package com.labor_management_system.Entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import lombok.Data;

/**
 * 工资记录
 * @TableName payroll
 */
@TableName(value ="payroll")
@Data
public class Payroll implements Serializable {
    /**
     * 
     */
    @TableId
    private String id;

    /**
     * 工人id
     */
    private String eid;

    /**
     * 当月出勤天数
     */
    private Integer attendanceDaysCmonth;

    /**
     * 当月工资
     */
    private Integer wages;

    /**
     * 考勤月份  XXXX-XX   年-月
     */
    private Long dates;

    /**
     * 累计应付工资
     */
    private Double accumulatedPayableWages;

    /**
     * 累计已付工资
     */
    private Double accumulatedPaidWages;

    /**
     * 累计欠付工资
     */
    private Double accumulatedUnpaidWages;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @TableField(exist = false)
    private String tname;

    @TableField(exist = false)
    private Employee employee;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        Payroll other = (Payroll) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getEid() == null ? other.getEid() == null : this.getEid().equals(other.getEid()))
            && (this.getAttendanceDaysCmonth() == null ? other.getAttendanceDaysCmonth() == null : this.getAttendanceDaysCmonth().equals(other.getAttendanceDaysCmonth()))
            && (this.getWages() == null ? other.getWages() == null : this.getWages().equals(other.getWages()))
            && (this.getDates() == null ? other.getDates() == null : this.getDates().equals(other.getDates()))
            && (this.getAccumulatedPayableWages() == null ? other.getAccumulatedPayableWages() == null : this.getAccumulatedPayableWages().equals(other.getAccumulatedPayableWages()))
            && (this.getAccumulatedPaidWages() == null ? other.getAccumulatedPaidWages() == null : this.getAccumulatedPaidWages().equals(other.getAccumulatedPaidWages()))
            && (this.getAccumulatedUnpaidWages() == null ? other.getAccumulatedUnpaidWages() == null : this.getAccumulatedUnpaidWages().equals(other.getAccumulatedUnpaidWages()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getEid() == null) ? 0 : getEid().hashCode());
        result = prime * result + ((getAttendanceDaysCmonth() == null) ? 0 : getAttendanceDaysCmonth().hashCode());
        result = prime * result + ((getWages() == null) ? 0 : getWages().hashCode());
        result = prime * result + ((getDates() == null) ? 0 : getDates().hashCode());
        result = prime * result + ((getAccumulatedPayableWages() == null) ? 0 : getAccumulatedPayableWages().hashCode());
        result = prime * result + ((getAccumulatedPaidWages() == null) ? 0 : getAccumulatedPaidWages().hashCode());
        result = prime * result + ((getAccumulatedUnpaidWages() == null) ? 0 : getAccumulatedUnpaidWages().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", eid=").append(eid);
        sb.append(", attendanceDaysCmonth=").append(attendanceDaysCmonth);
        sb.append(", wages=").append(wages);
        sb.append(", dates=").append(dates);
        sb.append(", accumulatedPayableWages=").append(accumulatedPayableWages);
        sb.append(", accumulatedPaidWages=").append(accumulatedPaidWages);
        sb.append(", accumulatedUnpaidWages=").append(accumulatedUnpaidWages);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}